@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");
/* 统一颜色变量 */
:root {
  --primary-color: #7B68EE;
  --primary-hover-color: #6A5ACD;
  --error-color: #ff4d4f;
  --text-primary: #333;
  --text-secondary: #666;
  --text-placeholder: #999;
  --border-color: #e0e0e0;
  --border-focus-color: #7B68EE;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 15px 35px rgba(0, 0, 0, 0.15);
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.25s ease;
  --border-radius-base: 10px;
  --border-radius-small: 8px;
}

/* 暗色模式变量 */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-placeholder: #888;
    --border-color: #444;
    --bg-card: #2d2d2d;
    --bg-input: #3d3d3d;
  }
}

/* 基础布局 */
.login-container {
  min-height: 100vh;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
  /* 键盘弹出时的调整 */
  padding-bottom: calc(20px + var(--keyboard-height, 0px));
}

/* 头部区域 */
.login-header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeIn 0.6s ease-out;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.login-logo image {
  width: 60px;
  height: 60px;
  margin-right: 10px;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #f0f0f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 卡片容器 */
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--border-radius-base);
  box-shadow: var(--shadow-medium);
  padding: 25px;
  margin-bottom: 30px;
  transition: var(--transition-base);
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-dark);
}

/* 标签切换 */
.form-tabs {
  display: flex;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
}

.tab-item {
  flex: 1;
  padding: 16px;
  font-size: 18px;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.tab-item.active {
  color: var(--primary-color);
  font-weight: bold;
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

/* 表单组 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 输入框包装器 */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 52px;
  padding: 0 45px 0 45px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  font-size: 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--border-focus-color);
  box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.15);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-placeholder);
}

/* 输入框图标 */
.input-icon {
  position: absolute;
  left: 15px;
  color: var(--text-placeholder);
  z-index: 1;
}

/* 密码可见性切换 */
.toggle-password {
  position: absolute;
  right: 15px;
  color: var(--text-placeholder);
  cursor: pointer;
  z-index: 1;
}

.toggle-password:hover {
  color: var(--primary-color);
}

/* 错误信息 */
.error-message {
  color: var(--error-color);
  font-size: 13px;
  margin: 8px 0 0 5px;
  display: block;
  animation: fadeIn 0.3s ease;
}

/* 表单操作 */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
  padding: 0 2px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.forgot-password {
  color: var(--primary-color);
  font-size: 14px;
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

/* 主要按钮 */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
  width: 100%;
  height: 52px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-small);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-light);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 80%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s;
}

.btn-primary:active::after {
  transform: translate(-50%, -50%) scale(1);
}

/* 加载图标 */
.loading-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 分割线 */
.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.divider text {
  padding: 0 16px;
}

/* 社交登录 */
.social-login {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.social-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--border-radius-small);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  padding: 0 20px;
  color: white;
  font-weight: 500;
  cursor: pointer;
}

.social-btn:hover {
  transform: translateY(-3px) scale(1.05);
}

.social-btn.wechat {
  background: #07C160;
}

.social-btn.qq {
  background: #12B7F5;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
  .login-container {
    padding: 20px 15px;
    /* 键盘弹出时的调整 */
    padding-bottom: calc(15px + var(--keyboard-height, 0px));
  }
  
  .login-card {
    padding: 20px;
    margin-bottom: 20px;
  }
  
  .login-title {
    font-size: 24px;
  }
  
  .login-subtitle {
    font-size: 13px;
  }
  
  .tab-item {
    padding: 14px;
    font-size: 16px;
  }
  
  .form-input {
    height: 48px;
    font-size: 15px;
  }
  
  .btn-primary {
    height: 48px;
    font-size: 15px;
  }
  
  .social-btn {
    height: 44px;
    padding: 0 15px;
    font-size: 14px;
  }
  
  /* 移动端滑动提示动画 */
  @keyframes slideHint {
    0% { transform: translateX(0); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(0); }
  }
  
  .slide-hint {
    animation: slideHint 1s ease-in-out infinite;
  }
}

@media screen and (max-width: 480px) {
  .login-container {
    padding: 15px 10px;
    /* 键盘弹出时的调整 */
    padding-bottom: calc(10px + var(--keyboard-height, 0px));
  }
  
  .login-card {
    padding: 15px;
  }
  
  .login-logo image {
    width: 50px;
    height: 50px;
  }
  
  .logo-text {
    font-size: 20px;
  }
  
  .login-title {
    font-size: 22px;
  }
  
  .tab-item {
    padding: 12px;
    font-size: 15px;
  }
  
  .form-input {
    height: 44px;
    font-size: 14px;
    padding: 0 40px 0 40px;
  }
  
  .input-icon,
  .toggle-password {
    left: 12px;
    right: 12px;
  }
  
  .btn-primary {
    height: 44px;
    font-size: 14px;
  }
  
  .social-btn {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }
}